Repository navigation
fix: Prevent polling from keeping a stale ETag after a response without one - #602
Merged
Merged
Conversation
…ut one The FDv2 polling requesters and the FDv1 fallback requesters, sync and async, kept the previous ETag when a 200 response had no ETag header. They then sent that old ETag in If-None-Match. If the server data returned to that earlier version, the server answered 304 and the SDK kept out-of-date data. Each requester now stores the ETag of every accepted response, and clears it when the response has none. A response whose payload is rejected leaves the stored ETag unchanged. Generated-by: termag
keelerm84
marked this pull request as ready for review
December 1, 2026 16:53
kinyoklion
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
The FDv2 polling requesters and the FDv1 fallback requesters, sync and async, kept the previous ETag when a 200 response had no ETag header. They then sent that old ETag in
If-None-Match, so if the server's data returned to that earlier version, the server answered 304 and the SDK kept out-of-date data. Each requester now stores the ETag of every accepted response and clears it when the response has none. A response whose payload is rejected leaves the stored ETag unchanged.Contract tests: launchdarkly/sdk-test-harness#704
Opened from termag
Note
Overview
Fixes stale ETag behavior in FDv2 and FDv1 fallback polling requesters (sync
Urllib3*and asyncAiohttp*).ETag updates now run only when the polling payload is accepted (
_Success). The stored value is set from every successful response and cleared when that response has noETag, so the client does not keep sendingIf-None-Matchfor an old version after the server omits the header. Rejected payloads leave the previous ETag unchanged.Adds
test_polling_requester_etag.pywith parametrized coverage for normal 304 behavior, clearing after a no-ETag 200, and preserving the ETag after invalid payloads.Reviewed by Cursor Bugbot for commit e8ba813. Bugbot is set up for automated code reviews on this repo. Configure here.